package com.xiaoma.verbal.scheduler;

import static com.xiaoma.verbal.utils.Constants.FTC;
import static com.xiaoma.verbal.utils.Constants.QCTC;
import static com.xiaoma.verbal.utils.Constants.QTTC;

import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.xiaoma.verbal.service.CacheService;
import com.xiaoma.verbal.service.ForecastService;
import com.xiaoma.verbal.service.QuClassicService;
import com.xiaoma.verbal.service.QuTpoService;
import com.xiaoma.verbal.service.QuestionService;
import com.xiaoma.verbal.utils.MemoryDB;
import com.xiaoma.verbal.webservice.VerbalQuestionWS;

@Component("cacheTask")
public class CacheManagementTask {
	private static Logger LOG = LoggerFactory.getLogger(CacheManagementTask.class);
	@Autowired
	private CacheService cacheService;

	// @Scheduled(cron = "0 0 2 * * *")
	@Scheduled(fixedRate = 60* 60 * 1000)
	public void reload() {
		try {
			this.cacheService.reloadTimeCoordinateCache();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	
}
